<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
 
</head>
<body>
   <p id="one" class="a">hello world <span>good</span></p>

    <script>
        // var p=document.getElementsByTagName("p")[0];
        // var nodeContent=p.textContent;
        // console.log(nodeContent);
        var p=document.getElementById("one");
        var eNode=p.nodeType;
        var tNode=p.firstChild.nodeType;
        var attr=p.getAttributeNode("class").nodeType;
        console.log(eNode);
        console.log(tNode);
        console.log(attr);
    </script>
</body>
</html>